import myaxios from "../MyAxios"
import BASE from '../BaseUrl'
const BMDURL = BASE.BMDURL



const shoppingApi = {
  //查询创意家居商品列表
  queryFurnishings() {
    let url = BMDURL + '/details'
    let params = { type_id: 101 }
    return myaxios.get(url, params)
  },
  //查询生活百货列表
  queryDailynecessities() {
    let url = BMDURL + '/details'
    let params = { type_id: 102 }
    return myaxios.get(url, params)
  },
  //查询健康美容列表
  queryCosmetology() {
    let url = BMDURL + '/details'
    let params = { type_id: 103 }
    return myaxios.get(url, params)
  },
    //查询时尚配饰列表
    queryJewelry() {
      let url = BMDURL + '/details'
      let params = { type_id: 104 }
      return myaxios.get(url, params)
    },

  //查询数码配件列表
  queryElectron() {
    let url = BMDURL + '/details'
    let params = { type_id: 105 }
    return myaxios.get(url, params)
  },
  //查询食品列表
  queryFood() {
    let url = BMDURL + '/details'
    let params = { type_id: 106 }
    return myaxios.get(url, params)
  },
  /**
* 通过关键字模糊查询商品列表
* @param {object} params  {name:'关键字'}
*/
  queryShoppingByName(name) {
    let url = BMDURL + "/details"
    return myaxios.get(url + `?title_like=${name}`)
  },

  //删除
  queryshoppingApiDel(id) {
    let url = BMDURL + `/details`
    return myaxios.delete(url + `/${id}`)
  },
  //新增
  queryShoppingAdd(param) {
    let url = BMDURL + `/details`
    return myaxios.post(url, param)
  }

}
export default shoppingApi